#!/usr/bin/python
# -*- coding: utf-8 -*-

#    THIS PROGRAM USE MINGUS Python Package
#

#    Jeremy Bernatchez-Sainvil master@1804hs.org 2012 (Scales finder)
#    mingus - Music theory Python package, scales module.
#    Copyright (C) 2008-2009, Bart Spaans
#    Copyright (C) 2011, Carlo Stemberger
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Scales finder 
# Choose a mode and a note, and that's it

from mingus.core import *
import mingus.core.scales as scales

print "Find the notes of a scale in a selected key. : master@1804hs.org \n "

print """[+]        Ancient scales
0.  Ionian
1.  Dorian
2.  Phrygian
3.  Lydian
4.  Mixolydian
5.  Aeolian
6.  Locrian
\n[+]        The minor scales
7.  Minor Neapolitan
8.  Bachian
9.  Harmonic Minor
10. Melodic Minor
11. Natural Minor
\n[+]        The Major Scales
12. Major
13. Harmonic Major
\n[+]        Other scales
14. Diatonic [off]
15. Chromatic
16. Whole Tone
17. Octatonic
18. Diminish note [no scales]
"""

user_mode = int(raw_input("Choose a mode (number) : "))

user_key = str.capitalize(raw_input("Enter a Key : "))


if user_mode == 0:
    print scales.Ionian(user_key)

if user_mode == 1:
    print scales.Dorian(user_key)

if user_mode == 2:
    print scales.Phrygian(user_key)

if user_mode == 3:
    print scales.Lydian(user_key)

if user_mode == 4:
    print scales.Mixolydian(user_key)

if user_mode == 5:
    print scales.Aeolian(user_key)

if user_mode == 6:
    print scales.Locrian(user_key)

if user_mode == 7:
    print scales.MinorNeapolitan(user_key)

if user_mode == 8:
    print scales.Bachian(user_key)

if user_mode == 9:
    print scales.HarmonicMinor(user_key)


if user_mode == 10:
    print scales.MelodicMinor(user_key)

if user_mode == 11:
    print scales.NaturalMinor(user_key)

if user_mode == 12:
    print scales.Major(user_key)

if user_mode == 13:
    print scales.HarmonicMajor(user_key)

if user_mode == 14:
    print 'Invalide'

if user_mode == 15:
    print scales.Chromatic(user_key)

if user_mode == 16:
    print scales.WholeTone(user_key)

if user_mode == 17:
    print scales.Octatonic(user_key)

if user_mode == 18:
    print scales.diminish(user_key)

